package com.lh.java.basic.clone;

class Obj {
	String str = "init value";

	public String toString() {
		return str;
	}
}

public class ObjRef {
	Obj aObj = new Obj();
	Integer aInt = 11;
	String cc="haha";

	public void changeObj(Obj inObj) {
		inObj.str = "changed value";
	}
	public void changeCc(String dto) {
		dto = "changed cc";
	}


	public void changePri(Integer inInt) {
		inInt = 22;
	}

	public static void main(String[] args) {
		ObjRef oRef = new ObjRef();

		System.out.println("Before call changeObj() method: " + oRef.aObj);
		oRef.changeObj(oRef.aObj);
		System.out.println("After call changeObj() method: " + oRef.aObj);

		System.out.println("==================Print Primtive=================");
		System.out.println("Before call changePri() method: " + oRef.aInt);
		oRef.changePri(oRef.aInt);
		System.out.println("After call changePri() method: " + oRef.aInt);
		
		System.out.println("Before call changePri() method: " + oRef.cc);
		oRef.changeCc(oRef.cc);
		System.out.println("After call changePri() method: " + oRef.cc);

	}
}